﻿using System;
  
namespace ReAnimation.Helpers.Common
{
    public static class EventHelper
    {
        public static void Throw(this EventHandler eventHandler, object sender, EventArgs eventArgs)
        {
            if(eventHandler != null)
                eventHandler.Invoke(sender,eventArgs);
        }

        public static void Throw<T>(this EventHandler<T> eventHandler,object sender,T eventArgs) where T:EventArgs
        {
            if(eventHandler != null)
                eventHandler.Invoke(sender,eventArgs);
        }
    }
}
